package com.wzc.hc.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wzc.hc.entity.po.Shop;
import com.wzc.hc.service.ShopService;
import com.wzc.hc.mapper.ShopMapper;
import org.springframework.stereotype.Service;

/**
* @author m1825
* @description 针对表【shop】的数据库操作Service实现
* @createDate 2025-03-03 16:59:09
*/
@Service
public class ShopServiceImpl extends ServiceImpl<ShopMapper, Shop>
    implements ShopService{

    @Override
    public void unbindShop(Integer id) {
        Shop shop = getById(id);
        if (shop != null) {
            shop.setBound(false);
            shop.setTenantId(null);
            updateById(shop);
        }
    }

    @Override
    public void rentShop(Integer id, Integer tenantId) {
        Shop shop = getById(id);
        if (shop != null) {
            shop.setBound(true);
            shop.setTenantId(tenantId);
            updateById(shop);
        }
    }
}




